package com.systop.asset.service.impl;

import com.systop.asset.entity.ProcessRecord;
import com.systop.asset.mapper.ProcessRecordMapper;
import com.systop.asset.service.IProcessRecordService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * 审批记录Service业务层处理
 * 
 * @author mu
 * @date 2025-06-24
 */
@Service
public class ProcessRecordServiceImpl implements IProcessRecordService 
{
    @Resource
    private ProcessRecordMapper processRecordMapper;

    /**
     * 查询审批记录
     * 
     * @param id 审批记录主键
     * @return 审批记录
     */
    @Override
    public ProcessRecord selectProcessRecordById(Long id)
    {
        return processRecordMapper.selectProcessRecordById(id);
    }

    /**
     * 查询审批记录列表
     * 
     * @param processRecord 审批记录
     * @return 审批记录
     */
    @Override
    public List<ProcessRecord> selectProcessRecordList(ProcessRecord processRecord)
    {
        return processRecordMapper.selectProcessRecordList(processRecord);
    }

    /**
     * 新增审批记录
     * 
     * @param processRecord 审批记录
     * @return 结果
     */
    @Override
    public int insertProcessRecord(ProcessRecord processRecord)
    {
        processRecord.setCreateTime(new Date());
        return processRecordMapper.insertProcessRecord(processRecord);
    }

    /**
     * 修改审批记录
     * 
     * @param processRecord 审批记录
     * @return 结果
     */
    @Override
    public int updateProcessRecord(ProcessRecord processRecord)
    {
        processRecord.setUpdateTime(new Date());
        return processRecordMapper.updateProcessRecord(processRecord);
    }

    /**
     * 批量删除审批记录
     * 
     * @param ids 需要删除的审批记录主键
     * @return 结果
     */
    @Override
    public int deleteProcessRecordByIds(Long[] ids)
    {
        return processRecordMapper.deleteProcessRecordByIds(ids);
    }

    /**
     * 删除审批记录信息
     * 
     * @param id 审批记录主键
     * @return 结果
     */
    @Override
    public int deleteProcessRecordById(Long id)
    {
        return processRecordMapper.deleteProcessRecordById(id);
    }
}
